
<html>
<head>
<meta charset="UTF-8">
<title>组装单词信息</title>
<link href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
<script src="../../ffres/dict/all.js"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
<script type="text/javascript">

	$(function() {
	
		$('#dg').datagrid({
	        onDblClickRow: function (rowIndex, rowData) {
	        	var code = $('#composit_code').val();
	        	var name = $('#composit_name').val();
	        	if(code == ''){
		        	//document.getElementById('composit_code').value = 'aaa';
	        		$("#composit_code").textbox('setValue',rowData.wordShortCode);
	        		$("#composit_name").textbox('setValue',rowData.wordCnDesc);
	        	} else {
	        		$("#composit_code").textbox('setValue',code + '_' + rowData.wordShortCode);
	        		$("#composit_name").textbox('setValue',name + rowData.wordCnDesc);
	        	}
	        }
	    });
	});

	function doSearch(){
    	var ss = $('#ss').val();
		$('#dg').datagrid('options').url = '../../api/dict/word/ss/' + ss ;
		$('#dg').datagrid('options').method='get';
		$('#dg').datagrid('load');
	};

	function reloadList(){
		$('#dg').datagrid('reload');
		JLEUtil.closewin();
	};

	function resetComposit(){
		$("#composit_code").textbox('setValue','');
		$("#composit_name").textbox('setValue','');
	}

	function returnResult(){
    	var code = $('#composit_code').val();
    	var name = $('#composit_name').val();
    	window.parent.returnChoiceWord(code,name);
    	$('#closeBtn').click();
	}
	
</script>
</head>
<body class="easyui-layout">
<div data-options="region:'center',split:false">
<table id="dg" class="easyui-datagrid" title="" style="width:100%;height:100%"
			data-options="singleSelect:true,collapsible:true,url:'../../api/dict/word/infos',method:'post'"
			toolbar="#tb"
		title="Load Data" 
		rownumbers="true" pagination="true" pageSize="20">
		<thead>
			<tr>
				<th data-options="field:'wordId',resizable:false" hidden="true">词汇标识</th>
				<th data-options="field:'wordShortCode',resizable:false" width="10%">词汇缩写</th>
				<th data-options="field:'wordEnDesc',resizable:false" width="20%">词汇英文描述</th>
				<th data-options="field:'wordCnDesc',resizable:false" width="20%">词汇中文描述</th>
				<th data-options="field:'createUser',resizable:false" width="15%">创者者</th>
				<th data-options="field:'createTime'" width="15%">创建时间</th>
			</tr>
		</thead>
	</table>
</div>
<div data-options="region:'south',split:false" title="" style="width:100%;height:60px;background: #F4F4F4;">
	<div style="text-align:center;padding:10px">
		 <a href="javascript:returnResult();" class="easyui-linkbutton">&nbsp;&nbsp;&nbsp;&nbsp;确&nbsp;&nbsp;&nbsp;&nbsp;定&nbsp;&nbsp;&nbsp;&nbsp;</a>
		 <a href="javascript:window.parent.JLEUtil.closewin();" id="closeBtn" class="easyui-linkbutton">&nbsp;&nbsp;&nbsp;&nbsp;关&nbsp;&nbsp;&nbsp;&nbsp;闭&nbsp;&nbsp;&nbsp;&nbsp;</a>
	</div>
</div>
<div id="tb" style="padding:1px">
	<input id="ss" class="easyui-searchbox" style="width:260px;height:25px" prompt="词汇缩写/词汇描述" searcher="doSearch"/>
	&nbsp;&nbsp;&nbsp;&nbsp;组合结果：<input class="easyui-textbox" style="height:23px" name="composit_code" id="composit_code" readonly/>
	&nbsp;&nbsp;<input class="easyui-textbox" style="height:23px" name="composit_name" id="composit_name" readonly/>
	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="resetComposit()">&nbsp;重&nbsp;置&nbsp;</a>
</div>
</body
</html>

